<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>POST</title>
</head>
<body>

    <input type="text" id="userId">
    <input type="text" id="classId">
    <input type="submit" id="submit">

    <script src="jquery.js"></script>
    <script>
        // $.ajax({
        //     type: 'post',
        //     url: 'method',
        //     success: function (body) {
        //         console.log(body)
        //     }
        // })


        let userIdInput = document.querySelector("#userId");
        let classIdInput = document.querySelector("#classId");
        let submit = document.querySelector("#submit");
        submit.onclick = function(){
            $.ajax({
                type: 'post',
                url: 'getParameter',
                contentType: "application/json",
                data: JSON.stringify({
                    userId: userIdInput.value,
                    classId: classIdInput.value,
                }),
                success: function (body) {
                    console.log(body)
                }
            })
        }
    </script>
</body>
</html>